package com.example.demo.feign;

import com.netflix.hystrix.HystrixCommand;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "defaultFeignClient", url="https://www.baidu.com")
public interface DefaultFeignClient {

    // https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu&wd=aaa&fenlei=256&rsv_pq=fadc065e000291ed&rsv_t=f01ccvyKya599j3nL0Hym3ffzsNLfa%2BJsuHYJfc2IaQzdY3YkOgt47CSeh8&rqlang=cn&rsv_enter=1&rsv_dl=tb&rsv_sug3=3&rsv_sug1=1&rsv_sug7=100&rsv_sug2=0&rsv_btype=i&inputT=506&rsv_sug4=506

    @RequestMapping(value = "s", method = RequestMethod.GET)
    String search(@RequestParam("wd") String wd);

    @RequestMapping(value = "s2", method = RequestMethod.GET)
    String search2(@RequestParam("wd") String wd);

    @RequestMapping(value = "s3", method = RequestMethod.GET)
    HystrixCommand<String> search3(@RequestParam("wd") String wd);
}